<!DOCTYPE HTML>

<html lang="en">
<head>

<title>DaoAuthenticationProvider (spring-security-docs 5.6.3 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="DaoAuthenticationProvider (spring-security-docs 5.6.3 API)";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">

<div class="topNav"><a id="navbar.top">

</a>
<div class="skipNav"><a href="DaoAuthenticationProvider.html#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">

</a></div>

</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>

<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.springframework.security.authentication.dao</a></div>
<h2 title="Class DaoAuthenticationProvider" class="title">Class DaoAuthenticationProvider</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider</a></li>
<li>
<ul class="inheritance">
<li>org.springframework.security.authentication.dao.DaoAuthenticationProvider</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code>org.springframework.beans.factory.Aware</code>, <code>org.springframework.beans.factory.InitializingBean</code>, <code>org.springframework.context.MessageSourceAware</code>, <code><a href="../AuthenticationProvider.html" title="interface in org.springframework.security.authentication">AuthenticationProvider</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">DaoAuthenticationProvider</span>
extends <a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></pre>
<div class="block">An <a href="../AuthenticationProvider.html" title="interface in org.springframework.security.authentication"><code>AuthenticationProvider</code></a> implementation that retrieves user details from a
<a href="../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a>.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">

</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider">

</a>
<h3>Fields inherited from class&nbsp;org.springframework.security.authentication.dao.<a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></h3>
<code><a href="AbstractUserDetailsAuthenticationProvider.html#hideUserNotFoundExceptions">hideUserNotFoundExceptions</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#logger">logger</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#messages">messages</a></code></li>
</ul>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">

</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#%3Cinit%3E()">DaoAuthenticationProvider</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">

</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">additionalAuthenticationChecks</a></span>&#8203;(<a href="../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;userDetails,
<a href="../UsernamePasswordAuthenticationToken.html" title="class in org.springframework.security.authentication">UsernamePasswordAuthenticationToken</a>&nbsp;authentication)</code></th>
<td class="colLast">
<div class="block">Allows subclasses to perform any additional checks of a returned (or cached)
<code>UserDetails</code> for a given authentication request.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected <a href="../../core/Authentication.html" title="interface in org.springframework.security.core">Authentication</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#createSuccessAuthentication(java.lang.Object,org.springframework.security.core.Authentication,org.springframework.security.core.userdetails.UserDetails)">createSuccessAuthentication</a></span>&#8203;(java.lang.Object&nbsp;principal,
<a href="../../core/Authentication.html" title="interface in org.springframework.security.core">Authentication</a>&nbsp;authentication,
<a href="../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;user)</code></th>
<td class="colLast">
<div class="block">Creates a successful <a href="../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a> object.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#doAfterPropertiesSet()">doAfterPropertiesSet</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected <a href="../../crypto/password/PasswordEncoder.html" title="interface in org.springframework.security.crypto.password">PasswordEncoder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#getPasswordEncoder()">getPasswordEncoder</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected <a href="../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#getUserDetailsService()">getUserDetailsService</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected <a href="../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#retrieveUser(java.lang.String,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">retrieveUser</a></span>&#8203;(java.lang.String&nbsp;username,
<a href="../UsernamePasswordAuthenticationToken.html" title="class in org.springframework.security.authentication">UsernamePasswordAuthenticationToken</a>&nbsp;authentication)</code></th>
<td class="colLast">
<div class="block">Allows subclasses to actually retrieve the <code>UserDetails</code> from an
implementation-specific location, with the option of throwing an
<code>AuthenticationException</code> immediately if the presented credentials are
incorrect (this is especially useful if it is necessary to bind to a resource as
the user in order to obtain or generate a <code>UserDetails</code>).</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder)">setPasswordEncoder</a></span>&#8203;(<a href="../../crypto/password/PasswordEncoder.html" title="interface in org.springframework.security.crypto.password">PasswordEncoder</a>&nbsp;passwordEncoder)</code></th>
<td class="colLast">
<div class="block">Sets the PasswordEncoder instance to be used to encode and validate passwords.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#setUserDetailsPasswordService(org.springframework.security.core.userdetails.UserDetailsPasswordService)">setUserDetailsPasswordService</a></span>&#8203;(<a href="../../core/userdetails/UserDetailsPasswordService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsPasswordService</a>&nbsp;userDetailsPasswordService)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DaoAuthenticationProvider.html#setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService)">setUserDetailsService</a></span>&#8203;(<a href="../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a>&nbsp;userDetailsService)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider">

</a>
<h3>Methods inherited from class&nbsp;org.springframework.security.authentication.dao.<a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></h3>
<code><a href="AbstractUserDetailsAuthenticationProvider.html#afterPropertiesSet()">afterPropertiesSet</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#authenticate(org.springframework.security.core.Authentication)">authenticate</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#getPostAuthenticationChecks()">getPostAuthenticationChecks</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#getPreAuthenticationChecks()">getPreAuthenticationChecks</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#getUserCache()">getUserCache</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#isForcePrincipalAsString()">isForcePrincipalAsString</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#isHideUserNotFoundExceptions()">isHideUserNotFoundExceptions</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setAuthoritiesMapper(org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper)">setAuthoritiesMapper</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setForcePrincipalAsString(boolean)">setForcePrincipalAsString</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setHideUserNotFoundExceptions(boolean)">setHideUserNotFoundExceptions</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setMessageSource(org.springframework.context.MessageSource)">setMessageSource</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setPostAuthenticationChecks(org.springframework.security.core.userdetails.UserDetailsChecker)">setPostAuthenticationChecks</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setPreAuthenticationChecks(org.springframework.security.core.userdetails.UserDetailsChecker)">setPreAuthenticationChecks</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#setUserCache(org.springframework.security.core.userdetails.UserCache)">setUserCache</a>, <a href="AbstractUserDetailsAuthenticationProvider.html#supports(java.lang.Class)">supports</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">

</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">

</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DaoAuthenticationProvider</h4>
<pre>public&nbsp;DaoAuthenticationProvider()</pre>
</li>
</ul>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">

</a>
<h3>Method Detail</h3>
<a id="additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>additionalAuthenticationChecks</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;additionalAuthenticationChecks&#8203;(<a href="../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;userDetails,
                                              <a href="../UsernamePasswordAuthenticationToken.html" title="class in org.springframework.security.authentication">UsernamePasswordAuthenticationToken</a>&nbsp;authentication)
                                       throws <a href="../../core/AuthenticationException.html" title="class in org.springframework.security.core">AuthenticationException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html#additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">AbstractUserDetailsAuthenticationProvider</a></code></span></div>
<div class="block">Allows subclasses to perform any additional checks of a returned (or cached)
<code>UserDetails</code> for a given authentication request. Generally a subclass
will at least compare the <a href="../../core/Authentication.html#getCredentials()"><code>Authentication.getCredentials()</code></a> with a
<a href="../../core/userdetails/UserDetails.html#getPassword()"><code>UserDetails.getPassword()</code></a>. If custom logic is needed to compare additional
properties of <code>UserDetails</code> and/or
<code>UsernamePasswordAuthenticationToken</code>, these should also appear in this
method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="AbstractUserDetailsAuthenticationProvider.html#additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">additionalAuthenticationChecks</a></code>&nbsp;in class&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>userDetails</code> - as retrieved from the
<a href="AbstractUserDetailsAuthenticationProvider.html#retrieveUser(java.lang.String,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)"><code>AbstractUserDetailsAuthenticationProvider.retrieveUser(String, UsernamePasswordAuthenticationToken)</code></a> or
<code>UserCache</code></dd>
<dd><code>authentication</code> - the current request that needs to be authenticated</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../core/AuthenticationException.html" title="class in org.springframework.security.core">AuthenticationException</a></code> - AuthenticationException if the credentials could
not be validated (generally a <code>BadCredentialsException</code>, an
<code>AuthenticationServiceException</code>)</dd>
</dl>
</li>
</ul>
<a id="doAfterPropertiesSet()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>doAfterPropertiesSet</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;doAfterPropertiesSet()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="AbstractUserDetailsAuthenticationProvider.html#doAfterPropertiesSet()">doAfterPropertiesSet</a></code>&nbsp;in class&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></code></dd>
</dl>
</li>
</ul>
<a id="retrieveUser(java.lang.String,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>retrieveUser</h4>
<pre class="methodSignature">protected final&nbsp;<a href="../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;retrieveUser&#8203;(java.lang.String&nbsp;username,
                                         <a href="../UsernamePasswordAuthenticationToken.html" title="class in org.springframework.security.authentication">UsernamePasswordAuthenticationToken</a>&nbsp;authentication)
                                  throws <a href="../../core/AuthenticationException.html" title="class in org.springframework.security.core">AuthenticationException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html#retrieveUser(java.lang.String,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">AbstractUserDetailsAuthenticationProvider</a></code></span></div>
<div class="block">Allows subclasses to actually retrieve the <code>UserDetails</code> from an
implementation-specific location, with the option of throwing an
<code>AuthenticationException</code> immediately if the presented credentials are
incorrect (this is especially useful if it is necessary to bind to a resource as
the user in order to obtain or generate a <code>UserDetails</code>).
<p>
Subclasses are not required to perform any caching, as the
<code>AbstractUserDetailsAuthenticationProvider</code> will by default cache the
<code>UserDetails</code>. The caching of <code>UserDetails</code> does present
additional complexity as this means subsequent requests that rely on the cache will
need to still have their credentials validated, even if the correctness of
credentials was assured by subclasses adopting a binding-based strategy in this
method. Accordingly it is important that subclasses either disable caching (if they
want to ensure that this method is the only method that is capable of
authenticating a request, as no <code>UserDetails</code> will ever be cached) or
ensure subclasses implement
<a href="AbstractUserDetailsAuthenticationProvider.html#additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)"><code>AbstractUserDetailsAuthenticationProvider.additionalAuthenticationChecks(UserDetails, UsernamePasswordAuthenticationToken)</code></a>
to compare the credentials of a cached <code>UserDetails</code> with subsequent
authentication requests.
</p>
<p>
Most of the time subclasses will not perform credentials inspection in this method,
instead performing it in
<a href="AbstractUserDetailsAuthenticationProvider.html#additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)"><code>AbstractUserDetailsAuthenticationProvider.additionalAuthenticationChecks(UserDetails, UsernamePasswordAuthenticationToken)</code></a>
so that code related to credentials validation need not be duplicated across two
methods.
</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="AbstractUserDetailsAuthenticationProvider.html#retrieveUser(java.lang.String,org.springframework.security.authentication.UsernamePasswordAuthenticationToken)">retrieveUser</a></code>&nbsp;in class&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>username</code> - The username to retrieve</dd>
<dd><code>authentication</code> - The authentication request, which subclasses <em>may</em>
need to perform a binding-based retrieval of the <code>UserDetails</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the user information (never <code>null</code> - instead an exception should
the thrown)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../core/AuthenticationException.html" title="class in org.springframework.security.core">AuthenticationException</a></code> - if the credentials could not be validated
(generally a <code>BadCredentialsException</code>, an
<code>AuthenticationServiceException</code> or
<code>UsernameNotFoundException</code>)</dd>
</dl>
</li>
</ul>
<a id="createSuccessAuthentication(java.lang.Object,org.springframework.security.core.Authentication,org.springframework.security.core.userdetails.UserDetails)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>createSuccessAuthentication</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../core/Authentication.html" title="interface in org.springframework.security.core">Authentication</a>&nbsp;createSuccessAuthentication&#8203;(java.lang.Object&nbsp;principal,
                                                     <a href="../../core/Authentication.html" title="interface in org.springframework.security.core">Authentication</a>&nbsp;authentication,
                                                     <a href="../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;user)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html#createSuccessAuthentication(java.lang.Object,org.springframework.security.core.Authentication,org.springframework.security.core.userdetails.UserDetails)">AbstractUserDetailsAuthenticationProvider</a></code></span></div>
<div class="block">Creates a successful <a href="../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a> object.
<p>
Protected so subclasses can override.
</p>
<p>
Subclasses will usually store the original credentials the user supplied (not
salted or encoded passwords) in the returned <code>Authentication</code> object.
</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="AbstractUserDetailsAuthenticationProvider.html#createSuccessAuthentication(java.lang.Object,org.springframework.security.core.Authentication,org.springframework.security.core.userdetails.UserDetails)">createSuccessAuthentication</a></code>&nbsp;in class&nbsp;<code><a href="AbstractUserDetailsAuthenticationProvider.html" title="class in org.springframework.security.authentication.dao">AbstractUserDetailsAuthenticationProvider</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>principal</code> - that should be the principal in the returned object (defined by
the <a href="AbstractUserDetailsAuthenticationProvider.html#isForcePrincipalAsString()"><code>AbstractUserDetailsAuthenticationProvider.isForcePrincipalAsString()</code></a> method)</dd>
<dd><code>authentication</code> - that was presented to the provider for validation</dd>
<dd><code>user</code> - that was loaded by the implementation</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the successful authentication token</dd>
</dl>
</li>
</ul>
<a id="setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setPasswordEncoder</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setPasswordEncoder&#8203;(<a href="../../crypto/password/PasswordEncoder.html" title="interface in org.springframework.security.crypto.password">PasswordEncoder</a>&nbsp;passwordEncoder)</pre>
<div class="block">Sets the PasswordEncoder instance to be used to encode and validate passwords. If
not set, the password will be compared using
<a href="../../crypto/factory/PasswordEncoderFactories.html#createDelegatingPasswordEncoder()"><code>PasswordEncoderFactories.createDelegatingPasswordEncoder()</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>passwordEncoder</code> - must be an instance of one of the <code>PasswordEncoder</code>
types.</dd>
</dl>
</li>
</ul>
<a id="getPasswordEncoder()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getPasswordEncoder</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../crypto/password/PasswordEncoder.html" title="interface in org.springframework.security.crypto.password">PasswordEncoder</a>&nbsp;getPasswordEncoder()</pre>
</li>
</ul>
<a id="setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setUserDetailsService</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setUserDetailsService&#8203;(<a href="../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a>&nbsp;userDetailsService)</pre>
</li>
</ul>
<a id="getUserDetailsService()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserDetailsService</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a>&nbsp;getUserDetailsService()</pre>
</li>
</ul>
<a id="setUserDetailsPasswordService(org.springframework.security.core.userdetails.UserDetailsPasswordService)">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setUserDetailsPasswordService</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setUserDetailsPasswordService&#8203;(<a href="../../core/userdetails/UserDetailsPasswordService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsPasswordService</a>&nbsp;userDetailsPasswordService)</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>

<footer role="contentinfo">
<nav role="navigation">

<div class="bottomNav"><a id="navbar.bottom">

</a>
<div class="skipNav"><a href="DaoAuthenticationProvider.html#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="DaoAuthenticationProvider.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">

</a></div>

</nav>
</footer>
<script>if (window.parent == window) {(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-2728886-23', 'auto', {'siteSpeedSampleRate': 100});ga('send', 'pageview');}</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"7040d12a7dc3980c","token":"bffcb8a918ae4755926f76178bfbd26b","version":"2021.12.0","si":100}' crossorigin="anonymous"></script>
</body>
</html>
